﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using LuaInterface;
public class LuaBinderMono : MonoBehaviour
{
	protected ScriptObjectWarp m_LuaScript;

	#region 外部标志
	public Component m_Bind;
	#endregion

	public void Init(){
		m_LuaScript = new ScriptObjectWarp("LuaBind", new object[] { this });
	}

	public void TableBind(LuaTable table)
	{
		//var tb = m_LuaScript.Table;
		//tb.SetTable( )
		Debug.Log("绑定");
		table.SetTable<Transform>("Bind", m_Bind as Transform);
		
		foreach (var item in table.ToDictTable())
		{
			Debug.Log(item.Key + "    " +item.Value);
		}
	}
	public void CallFunc(string funcName)
	{
		m_LuaScript.CallFunc(funcName, new object[1] { m_LuaScript.Table });
	}

	public void Say(Vector3 vector)
	{
		Debug.Log(vector);
	}

	public struct ComponentField
	{
		public string FieldKey;	
	}
}
